-
Notifications
You must be signed in to change notification settings - Fork 38
common: remove cgv1 for podman6 #417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
✅ A new PR has been created in buildah to vendor these changes: containers/buildah#6449 |
e82ef0f to
c69aaf4
Compare
|
Packit jobs failed. @containers/packit-build please check. |
1c21882 to
453e6e8
Compare
9002044 to
7cf077c
Compare
7cf077c to
c30076c
Compare
|
@Luap99 @mtrmac PTAL. Smaller commits so should be hopefully easier to review. I haven't removed any of the IsCgroup2UnifiedMode calls where there were error checks. Only assumed the bool to be true there, and removed the cgv1 parts. Unless there are any critical blockers like some change being obviously wrong or some cgv1 logic still present and open to being called, I'd prefer to leave any cleanups / simplifications for followup. |
|
should obsolete #387 |
Replace with cgroups.IsCgroup2UnifiedMode. Signed-off-by: Lokesh Mandvekar <[email protected]>
And all the cgroup v1 logic that relied on the cgroup2 bool Signed-off-by: Lokesh Mandvekar <[email protected]>
- exclude param from getAvailableControllers - cgroupV1GetAllSubsystems - CgroupControl.createGroupDirectory - readAcct - readAcctList Signed-off-by: Lokesh Mandvekar <[email protected]>
Also inline some struct element values with constant values Signed-off-by: Lokesh Mandvekar <[email protected]>
Signed-off-by: Lokesh Mandvekar <[email protected]>
Signed-off-by: Lokesh Mandvekar <[email protected]>
Signed-off-by: Lokesh Mandvekar <[email protected]>
Signed-off-by: Lokesh Mandvekar <[email protected]>
I can only see it being called in libpod/oci_conmon_linux.go that too when CgroupManager is not systemd, so it should be safe to remove. Signed-off-by: Lokesh Mandvekar <[email protected]>
Signed-off-by: Lokesh Mandvekar <[email protected]>
Signed-off-by: Lokesh Mandvekar <[email protected]>
df3ce3a to
26e4421
Compare
Signed-off-by: Lokesh Mandvekar <[email protected]>
|
@mheon PTAL. |
|
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is really much easier to review when split.
(Reviewed only locally reading the code, I don’t know much about cgroups. Leaving follow-ups for a separate PR as requested.)
| } | ||
| return subsystems, nil | ||
| // AvailableControllers get string:bool map of all the available controllers. | ||
| func AvailableControllers(exclude map[string]controllerHandler) ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In “Remove unused parameters and functions post CgroupControl cleanup”: Drop the unused exclude parameter as well?
(And, separately, getAvailableControllers could be inlined into this only caller.)
| } | ||
| if res.MemorySwap != 0 { | ||
| switch { | ||
| case res.Memory == -1 || res.MemorySwap == -1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Turning this into if would be nicer.)
| "strings" | ||
|
|
||
| "github.com/opencontainers/cgroups" | ||
| "github.com/opencontainers/cgroups/fs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lsm5 in all of these handler packages, we import cgroups/fs to declare fields which are never used, so it looks like this can be simplified further.
… and that makes #387 (comment) even more attractive.
| } | ||
|
|
||
| type controllerHandler interface { | ||
| Create(*CgroupControl) (bool, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lsm5 linuxCpusetHandler.Create still exists — what should happen there? Either it is all obsolete and the code should be removed, or it is still relevant and the .Create method (and .Destroy?) need to be reinstated.
Ref: containers#417 (comment) Signed-off-by: Lokesh Mandvekar <[email protected]>
Ref: containers#417 (comment) Signed-off-by: Lokesh Mandvekar <[email protected]>
This broke a lot of stuff, so this should only be re-reverted once things are known to work in Podman and Buildah. Commits reverted: - e94388d - 26e4421 - b7be55c - cce5ec8 - 5f98dfb - ceaec36 - ed47881 - 2cf45c5 - 80309d7 - 8251431 - ff00d90 - 213e7ec Ref: containers#417 Signed-off-by: Lokesh Mandvekar <[email protected]>
Following up on review comments in #387 . Reattempting with finer commits for easier review.